﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QLWeb_XDPM.Data;
using System.Data;

namespace QLWeb_XDPM.Bussiness_Logical
{
    class QuanTri
    {
        #region "Atribute"
        string tenDN;
        string hoTen;
        string diaChi;
        string dienthoai;
        string matKhau;
        string nhapLaiMatKhau;
        #endregion

        #region "Property"

        public string TenDN
        {
            get { return tenDN; }
            set { tenDN = value; }
        }

        public string HoTen
        {
            get { return hoTen; }
            set { hoTen = value; }
        }

        public string DiaChi
        {
            get { return diaChi; }
            set { diaChi = value; }
        }

        public string DienThoai
        {
            get { return dienthoai; }
            set { dienthoai = value; }
        }
        public string MatKhau
        {
            get { return matKhau; }
            set { matKhau = value; }
        }    
        
        public string NhapLaiMatKhau
        {
            get { return nhapLaiMatKhau; }
            set { nhapLaiMatKhau = value; }
        }
        #endregion
        #region "Method................................."

        KetNoi kn = new KetNoi();
       

        //phuong thuc lay danh sach Quan Tri
        /* public DataTable SelectQT()
         {
             string select = "Select qt.TenDNA,qt.HoTeA,nv.diachi,nv.dienthoaifrom QuanTri qt ";
             DataTable tb=kn.getdata(select,null).Tables[0];
             return tb;
         }*/

        #endregion

        #region "Phuong thuc doi mat khau...................."
        
        public bool DoiMatKhau(string makhaumoi)
        {
            IDictionary<string, string> d = new Dictionary<string, string>();
            string truyvan = "update QuanTri set MatKhau = @MK where TenDNA=@TenDN";
            d.Add("@MK", makhaumoi);
            d.Add("@TenDNA", tenDN);
            if (kn.ThucHienCauTruyVan(truyvan, d))
                return true;
            return false;
        }
        #endregion

           



       }
}

    